package com.aqarat.entity;

import java.sql.Timestamp;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.core.entity.BaseEntity;
import com.core.entity.Lookup;

/**
 * Entity implementation class for Entity: Payment
 * 
 */
@Entity
@Table(name = "payments")
public class Payment extends BaseEntity {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name = "recid", unique = true, nullable = false)
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Long recid;

	private Double money;

	@Column(name = "is_first_payment", length = 1)
	private Long isFirstPayment;

	@Column(name = "payment_date")
	private Date paymentDate;

	@Column(name = "apartment_id")
	private Long apartmentId;

	@ManyToOne
	@JoinColumn(name = "apartment_id", insertable = false, updatable = false)
	private Apartment apartment;

	@Column(name = "customer_id")
	private Long customerId;

	@ManyToOne
	@JoinColumn(name = "customer_id", insertable = false, updatable = false)
	private Customer customer;

	@ManyToOne
	@JoinColumn(name = "status")
	private Lookup status;
	// -----------------------------------/
	@Transient
	private Date dateFrom;
	@Transient
	private Date dateTo;

	public Payment() {
	}

	public Payment(Long recid, Double money, Long isFirstPayment, Date paymentDate, Long apartmentId, Long customerId, Lookup status) {
		super();
		this.recid = recid;
		this.money = money;
		this.isFirstPayment = isFirstPayment;
		this.paymentDate = paymentDate;
		this.apartmentId = apartmentId;
		this.customerId = customerId;
		this.status = status;
	}
	public Payment(Long recid, Double money, Date paymentDate, Lookup status, Long customerId, Long apartmentId) {
		super();
		this.recid = recid;
		this.money = money;
		this.paymentDate = paymentDate;
		this.status=status ;
		this.customerId = customerId;
		this.apartmentId = apartmentId;
	}
	
	
	
	@Override
	public String toString() {
		return "Payment [recid=" + recid + ", money=" + money + ", isFirstPayment=" + isFirstPayment + ", paymentDate=" + paymentDate + ", apartmentId=" + apartmentId + ", apartment=" + apartment + ", customerId=" + customerId + ", customer=" + customer + ", status=" + status + ", dateFrom=" + dateFrom + ", dateTo=" + dateTo + "]";
	}

	public Long getRecid() {
		return recid;
	}

	public void setRecid(Long recid) {
		this.recid = recid;
	}

	public Double getMoney() {
		return money;
	}

	public void setMoney(Double money) {
		this.money = money;
	}

	public void setIsFirstPayment(Long isFirstPayment) {
		this.isFirstPayment = isFirstPayment;
	}

	public Long getIsFirstPayment() {
		return isFirstPayment;
	}

	public Date getPaymentDate() {
		return paymentDate;
	}

	public void setPaymentDate(Date paymentDate) {
		this.paymentDate = paymentDate;
	}

	public Long getApartmentId() {
		return apartmentId;
	}

	public void setApartmentId(Long apartmentId) {
		this.apartmentId = apartmentId;
	}

	public void setApartment(Apartment apartment) {
		this.apartment = apartment;
	}

	public Apartment getApartment() {
		return apartment;
	}

	public Long getCustomerId() {
		return customerId;
	}

	public void setCustomerId(Long customerId) {
		this.customerId = customerId;
	}

	public Lookup getStatus() {
		return status;
	}

	public void setStatus(Lookup status) {
		this.status = status;
	}

	public void setCustomer(Customer customer) {
		this.customer = customer;
	}

	public Customer getCustomer() {
		return customer;
	}

	public Date getDateFrom() {
		return dateFrom;
	}

	public void setDateFrom(Date dateFrom) {
		this.dateFrom = dateFrom;
	}

	public Date getDateTo() {
		return dateTo;
	}

	public void setDateTo(Date dateTo) {
		this.dateTo = dateTo;
	}

}
